from fastapi import APIRouter
from app.apis import auth_api, task_api, user
from app.apis.admin import (
    admin_file_manage_api,
    admin_storage_provider_manage_api,
    admin_sys_access_log_api,
    admin_user_manage_api,
)

from app.core.i18n import t
from app.schemas.response import Response

api_router = APIRouter()

api_router.include_router(user.router, prefix="/users")
api_router.include_router(task_api.router, prefix="/tasks", tags=["tasks"])
api_router.include_router(auth_api.router, prefix="/auth")

# admin
api_router.include_router(admin_user_manage_api.router, prefix="/admin/users", tags=["admin"])
api_router.include_router(admin_storage_provider_manage_api.router, prefix="/admin/storage_provider", tags=["admin"])
api_router.include_router(admin_file_manage_api.router, prefix="/admin/file", tags=["admin"])
api_router.include_router(admin_sys_access_log_api.router, prefix="/system/access_log", tags=["admin"])


@api_router.get("/health", tags=["health"], response_model=Response)
def health():
    return Response.success(message=t("common.health_check_success"))
